package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.commons.lang3.RandomUtils;

import java.util.concurrent.TimeUnit;


public class HelloServiceImpl  implements HelloService {
    @Override
    public String sayHelloA(String name){
        try {
            int randomTime = RandomUtils.nextInt(0, 100);
            TimeUnit.MILLISECONDS.sleep(randomTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "helloA:"+name;
    }

    @Override
    public String sayHelloB(String name) {
        try {
            int randomTime = RandomUtils.nextInt(0, 100);
            TimeUnit.MILLISECONDS.sleep(randomTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "helloB:"+name;
    }

    @Override
    public String sayHelloC(String name) {
        try {
            int randomTime = RandomUtils.nextInt(0, 100);
            TimeUnit.MILLISECONDS.sleep(randomTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "helloC:"+name;
    }
}
